import type { FilterItem, PageResult } from "../types/global";
import type { TalentDetail, TalentItem } from "../types/talent";
import http from "../utils/http";
// 招聘分类
export const postTalentCategory = () => {
  return http<FilterItem[]>({
    url: "TalentCategory/all",
    method: "POST",
  });
};

// 航空类型
export const postTalentAir = () => {
  return http<FilterItem[]>({
    url: "TalentAir/all",
    method: "POST",
  });
};
// 职位类型
export const postTalentPosition = () => {
  return http<FilterItem[]>({
    url: "TalentPosition/all",
    method: "POST",
  });
};
// 航空地点
export const postTalentAddress = () => {
  return http<FilterItem[]>({
    url: "TalentAddress/all",
    method: "POST",
  });
};
// 薪资范围
export const postTalentSalary = () => {
  return http<FilterItem[]>({
    url: "TalentSalary/all",
    method: "POST",
  });
};
// 工作经验
export const postTalentWork = () => {
  return http<FilterItem[]>({
    url: "TalentWork/all",
    method: "POST",
  });
};
// 证书要求
export const postTalentCert = () => {
  return http<FilterItem[]>({
    url: "TalentCert/all",
    method: "POST",
  });
};
// 学历要求
export const postTalentEdu = () => {
  return http<FilterItem[]>({
    url: "TalentEdu/all",
    method: "POST",
  });
};
// 招聘分类
export const postTalentTag = () => {
  return http<FilterItem[]>({
    url: "TalentTag/all",
    method: "POST",
  });
};

// 获取人才招聘列表数据
export const postTalentList = (data) => {
  return http<PageResult<TalentItem[]>>({
    url: "tanlent/index",
    method: "POST",
    data,
  });
};

// 获取学院就业列表
export const MemberHonor = () => {
  return http<any[]>({
    url: "Member/honor",
    method: "POST",
  });
};

// 职位申请提交
export const SubmitJob = (data) => {
  return http<any[]>({
    url: "TanlentSubmit/create",
    method: "POST",
    data,
  });
};

// 获取人才招聘详情
export const postTalentDetail = (id: number) => {
  return http<TalentDetail>({
    url: "Tanlent/view",
    method: "POST",
    data: { id },
  });
};

// 职位 收藏|取消收藏
export const postTalentCollect = ({ id, member_id }) => {
  return http<any>({
    url: "Tanlent/tab_collect",
    method: "POST",
    data: {
      id,
      member_id,
      controller: "Tanlent",
    },
  });
};
